{%  extends "admin_base.html" %}

{% block left_body %}
        <ul class="nav flex-column nav-pills">
        <li class="nav-item">
            <a  class="nav-link active" href="/">转到主界面</a>
        </li>
          <li class="nav-item">
            <a  class="nav-link" href="/admin/">转到管理界面</a>
          </li>
                  <li class="nav-item">
            <a  class="nav-link" href="add/">添加图书入库点这里</a>
          </li>
        </ul>
{% endblock %}

{% block right_body %}
    <br>
    <h3>在库图书</h3>
  <table class="table table-bordered">
  <thead>
  <tr class="table-active">
      <th>ISBN</th>
      <th>书名</th>
      <th>类别</th>
      <th>作者</th>
      <th>出版社</th>
      <th>价格</th>
      <th>剩余数量</th>
      <th>下架操作</th>
  </tr>
  </thead>
{% for row in exist %}
<tr class="table-success">
    <td>{{ row[0] }}</td>
    <td>{{ row[1] }}</td>
    <td>{{ row[3] }}</td>
    <td>{{ row[4] }}</td>
    <td>{{ row[5] }}</td>
    <td>{{ row[6] }}</td>
    <td>{{ row[7] }}</td>
<td>
    <form role="form" action="/admin/book-control/remove/" method="post">
    <input type="hidden" value="{{ row[0] }}" name="ISBN">
    <input type="hidden" value="{{ row[7] }}" name="num">
        <div class="form-group">
        <label for="date">
            手动输入日期（因为这个如果自动日期，不便测试）
        </label>
        <input type="date" class="form-control" name="date" />
    </div>
    <button type="submit" class="btn btn-primary">
        确认下架
    </button>
</form>
</td>
</tr>
{% endfor %}
</table>

<h3>删除图书</h3>
  <table class="table table-bordered">
  <tr class="table-active">
      <th>ISBN</th>
      <th>书名</th>
      <th>类别</th>
      <th>作者</th>
      <th>出版社</th>
      <th>价格</th>
      <th>剩余数量</th>
      <th>恢复操作</th>
  </tr>
{% for row in removed %}
<tr class="table-danger">
    <td>{{ row[0] }}</td>
    <td>{{ row[1] }}</td>
    <td>{{ row[3] }}</td>
    <td>{{ row[4] }}</td>
    <td>{{ row[5] }}</td>
    <td>{{ row[6] }}</td>
    <td>{{ row[7] }}</td>
<td>
    <form role="form" action="/admin/book-control/reset/" method="post">
    <input type="hidden" value="{{ row[0] }}" name="ISBN">
    <input type="hidden" value="{{ row[7] }}" name="num">
                <div class="form-group">
        <label for="num">
            上架数目</label>
        <input type="number" class="form-control" name="num" />
    </div>
        <div class="form-group">
        <label for="date">
            手动输入日期（因为这个如果自动日期，不便测试）
        </label>
        <input type="date" class="form-control" name="date" />
    </div>
    <button type="submit" class="btn btn-primary">
        确认恢复
    </button>
</form>
</td>
</tr>
{% endfor %}
</table>

{% endblock %}